package util.http

trait ConsoleLog extends Log {
  def errorEnabled = true
  def warnEnabled = true
  def debugEnabled = true
  def infoEnabled = true
  private def printLog(typz: String, mes: Any, e: Throwable) = {
    println(typz + ":" + mes)
    if (e != null) e.printStackTrace()
  }
  def error(mes: => Any = "", e: Throwable = null) = printLog("error", mes, e)
  def info(mes: => Any = "", e: Throwable = null) = printLog("info", mes, e)
  def debug(mes: => Any = "", e: Throwable = null) = printLog("debug", mes, e)
  def warn(mes: => Any = "", e: Throwable = null) = printLog("warn", mes, e)
}
object ConsoleLog extends ConsoleLog

trait WithConsoleLog extends Logable {
  protected def log = ConsoleLog
}